package com.zl.tby.icc;

import com.zl.tby.model.TbyFaceRecord;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author changpeng
 * @version 1.0
 * @since 2024/10/24 8:42
 */
@Data
public class IccFaceInfo {
    private Long detectTime;
    private String devId;
    private String devChnname;
    private String faceMinUrl;
    private String imageUrl;

    public static TbyFaceRecord convert(IccFaceInfo info) {
        TbyFaceRecord entity = new TbyFaceRecord();
        entity.setBigImg(info.getImageUrl());
        entity.setSmallImg(info.getFaceMinUrl());
        entity.setDevId(info.getDevId());
        entity.setDevName(info.getDevChnname());
        entity.setGrabTime(new Date(info.getDetectTime()));
        entity.setDeleteFlag(0);
        entity.setCreateTime(LocalDateTime.now());
        entity.setCreateBy(-1L);
        return entity;
    }
}
